<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>6.270 - JoyOS: digital.h File Reference</title>
	<link href="main.css" media="screen" rel="Stylesheet" type="text/css"/>
	<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>  
<body>
	<div id="header">
		<div id="headerb">
		<div id="headtext">
			<span class="titletext">AUTONOMOUS ROBOT DESIGN COMPETITION</span>
			6.270
		</div>
		<div class="mainmenu">
			<a href="http://web.mit.edu/6.270/www">Home</a>
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/about/">About</a> 
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/sponsors/">Sponsors</a>
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/contests/">Past Contests</a> 
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/contestants/">Contestant Information</a>
		</div>
	</div>
	</div>

<div class="maincontent">
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>digital.h File Reference</h1>Digital Inputs. <a href="#_details">More...</a>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="digital_8h.html#7b2aa66f743a986c626b61bcd117a3c2">digital_init</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="digital_8h.html#9161d5a57674f4ac5241216247d2aa42">digital_read_8</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="digital_8h.html#f4e0cff11fb408c37851f2f531276cdc">digital_read</a> (uint8_t port)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The Happyboard has 8 digital inputs.<p>
The digital inputs on the Happyboard are unfiltered and as such there is "switch bounce" when they are connected to bump-sensors. To compensate for this users should read digital inputs a few times with short delays between readings to ensure accurate sensing. <hr><h2>Function Documentation</h2>
<a class="anchor" name="7b2aa66f743a986c626b61bcd117a3c2"></a><!-- doxytag: member="digital.h::digital_init" ref="7b2aa66f743a986c626b61bcd117a3c2" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void digital_init           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Initialize digital ports. Should not be called by user. 
</div>
</div><p>
<a class="anchor" name="f4e0cff11fb408c37851f2f531276cdc"></a><!-- doxytag: member="digital.h::digital_read" ref="f4e0cff11fb408c37851f2f531276cdc" args="(uint8_t port)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t digital_read           </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>port</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return the value of a specific digital port. If the port specified is an analog port (8-23), <a class="el" href="digital_8h.html#f4e0cff11fb408c37851f2f531276cdc">digital_read()</a> returns the equivalent digital reading - &lt;2.5V: FALSE &gt;=2.5V: TRUE. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>port</em>&nbsp;</td><td>port to read (0-23) </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="9161d5a57674f4ac5241216247d2aa42"></a><!-- doxytag: member="digital.h::digital_read_8" ref="9161d5a57674f4ac5241216247d2aa42" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t digital_read_8           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return the value of all of the digital ports as a single packed byte. The least significant bit is port 0, the most significant is port 7. 
</div>
</div><p>
</div>
</div>
<div class="maincontent">
	<div class="footer centre">
		<hr>
		Generated on Sun Jan 18 22:59:34 2009 by&nbsp;<a href="http://www.doxygen.org/index.html">Doxygen</a> 1.5.6<br/>
		6.270 Staff, 2008 | 
		<a href="mailto:6.270-organizers@mit.edu">Contact Us</a> | 
		<a href="http://web.mit.edu">MIT</a>
	</div>
</div>
</body>
</html>
